<template>
  <div id="Percentage" style="width: 100%; height:100%;"></div>
</template>

<script>
export default {
  name: "PercentageView",
  data() {
    return {
      //
      option: {
        title: {
          text: '歌曲类型占比',
          textStyle: {
            fontSize: 15
          },
          bottom: '0',
          right: '170',
        },
        tooltip: {
          trigger: 'item'
        },
        legend: {
          type: 'scroll',
          orient: 'vertical',
          left: 20,
          top: 5
        },
        series: [
          {
            name: 'Access From',
            type: 'pie',
            radius: ['40%', '70%'],
            avoidLabelOverlap: false,
            label: {
              show: false,
              position: 'center'
            },
            emphasis: {
              label: {
                show: true,
                fontSize: '40',
                fontWeight: 'bold'
              }
            },
            labelLine: {
              show: false
            },
            data: [
              {value: 1048, name: '流行'},
              {value: 735, name: '爵士'},
              {value: 580, name: '摇滚'},
              {value: 484, name: '蓝调'},
              {value: 300, name: '其他'}
            ]
          }
        ]
      },
    }
  }
  ,
  mounted() {
    this.drawChart();
  }
  ,
  created() {

  }
  ,
  methods: {
    drawChart() {
      let chart = this.$echarts.init(document.getElementById("Percentage"));
      chart.setOption(this.option);
    }
  }
}
</script>

<style scoped>

</style>
